﻿@using Microsoft.AspNetCore.Identity
@inject SignInManager<PersonModel> SignInManager
@inject UserManager<PersonModel> UserManager

<ul class="navbar-nav">
@if (SignInManager.IsSignedIn(User))
{
                    
    <li class="nav-item dropdown">
        <button class="dropdown-toggle headImgBtn" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
            <img src="/img/simple.png" alt="头像" width="40px" height="40px">
        </button>
        <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
            <li>
                <a class="dropdown-item" href="#">个人中心</a>
            </li>
            <li>
                <a class="dropdown-item" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">账号设置</a>
            </li>
            <li>
                <form  class="dropdown-item" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
                    <button type="submit" class="nav-link btn btn-link text-dark" style="padding: 0%;">注销登录</button>
                </form>
            </li>
        </ul>
    </li>   
    <li class="nav-item">
        <a  class="nav-link text-dark" asp-area="" asp-controller="Blog" asp-action="Create" title="Manage">新建博客</a>
    </li>
}
else
{
    <li class="nav-item">
        <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">注册</a>
    </li>
    <li class="nav-item">
        <a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">登录</a>
    </li>
}
</ul>
